﻿package wibrst.loading {
	import flash.system.ApplicationDomain;
	/**
	 * ...
	 * @author wibrst@qq.com
	 */
	public class LoadUnit {
		
		private var _sUrl:String;
		private var _appDomain:ApplicationDomain;
		private var _sId:String;
		private var _sPrompt:String;
		
		public function LoadUnit( 
					sUrl:String, 
					sId:String,
					sPrompt:String = "",
					appDomain:ApplicationDomain = null
		) {
			this._sUrl = sUrl;
			this._sId = sId;
			this._sPrompt = sPrompt;
			
			if ( !appDomain ) appDomain = new ApplicationDomain( ApplicationDomain.currentDomain );
			this._appDomain = appDomain;
		}
		
		public function addUrlSuffix( sSuffix:String ):void {
			this._sUrl += sSuffix;
		}
		
		public function get sUrl():String { return _sUrl; }
		
		public function get sId():String { return _sId; }
		
		public function get sPrompt():String { return _sPrompt; }
		
		public function get appDomain():ApplicationDomain { return _appDomain; }
		
		public function toString():String {
			return "[LoadUnit sUrl:" + _sUrl + " appDomain:" + _appDomain + "]";
		}
		
	}

}